package productions;

import lexico.ErrorTable;
import lexico.SymbolTable;
import lexico.TokenClass;

/**
 * @author Douglas
 * @author heekinho
 */
public class OpRelacionalProduction extends AbstractProductionRule {

    private static OpRelacionalProduction instance = new OpRelacionalProduction();
    public static OpRelacionalProduction getInstance(){ return instance; }

    


    @Override
    public boolean analyze(SymbolTable st, ErrorTable et) {
            return basicTerminalParsing(st);
    }

    @Override
    protected void populateFirst() {
        this.first.add(TokenClass.OPERATOR_LESS);
        this.first.add(TokenClass.OPERATOR_LESS_EQUAL);
        this.first.add(TokenClass.OPERATOR_MORE);
        this.first.add(TokenClass.OPERATOR_MORE_EQUAL);
        this.first.add(TokenClass.OPERATOR_DIFFERENT);
        this.first.add(TokenClass.OPERATOR_EQUAL);
    }

    @Override
    protected void populateFollow() {
        //from exprarit first
        follow.add(TokenClass.OPERATOR_NOT);
        follow.add(TokenClass.DELIMITER_OPENING_PARENTHESIS);
        follow.add(TokenClass.NUMERIC);
        follow.add(TokenClass.NUMERIC_REAL);
        follow.add(TokenClass.KEYWORD_VERDADEIRO);
        follow.add(TokenClass.KEYWORD_FALSO);
        follow.add(TokenClass.IDENTIFIER);
        this.follow.add(TokenClass.OPERATOR_PLUS);
        this.follow.add(TokenClass.OPERATOR_MINUS);
        follow.add(TokenClass.OPERATOR_INCREMENT);
        follow.add(TokenClass.OPERATOR_DECREMENT);
        this.follow.add(TokenClass.KEYWORD_CAST);
    }

}
